/**
 * 
 */
package dao.hibernate;

import hibernate.Person;
import model.IPerson;

import org.hibernate.criterion.Restrictions;

import dao.IPersonDAO;


/**
 * @author isaac
 *
 */
public class PersonDAO extends BaseHibernateDAO implements IPersonDAO {
	/* (non-Javadoc)
	 * @see dao.IPersonDAO#getPersonByUsername(java.lang.String)
	 */
	public IPerson getPersonByUsername(String username) {
		return (IPerson)sessionFactory.getCurrentSession()
					.createCriteria(Person.class)
					.add(Restrictions.eq("username", username))
					.uniqueResult();
	}
}
